package com.md.config.database.note;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 刘骄阳
 * 2023-12-20 15:41
 */
@Configuration
public class NoteInterceptorConfig {

  @Bean
  @ConditionalOnProperty(name = "datasource.enable-note", havingValue = "true")
  public NoteInterceptor noteInterceptor(@Autowired(required = false) final NoteSQLConfig noteSQLConfig) {
    return new NoteInterceptor(noteSQLConfig);
  }
}
